Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

working solution #1204

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

working solution #1204

wants to merge 2 commits into from

Conversation

Krykunov
Copy link

@Krykunov Krykunov commented Dec 3, 2024

Copy link

@Moroz-Dmytro Moroz-Dmytro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good progress 👍
But you need to fix all tests

src/App.tsx Outdated
>
Something went wrong!
</div>
const isShowPostsBlock = currentUser && !isPostsError && !isPostsLoading;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const isShowPostsBlock = currentUser && !isPostsError && !isPostsLoading;
const isPostsBlockShown = currentUser && !isPostsError && !isPostsLoading;

src/App.tsx Outdated
<UserSelector />
</div>
export const App: React.FC = () => {
const [isShowForm, setIsShowForm] = useState(false);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [isShowForm, setIsShowForm] = useState(false);
const [isFormShown, setIsFormShown] = useState(false);

src/App.tsx Outdated
)}

{isShowPostsBlock &&
(posts.length === 0 ? (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(posts.length === 0 ? (
(!posts.length ? (

delete button
</button>
</div>
{isShowCommentsBlock && comments.length === 0 && (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create variable

{'Multi\nline\ncomment'}
</div>
</article>
{isShowCommentsBlock && comments.length !== 0 && (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create variable

Comment on lines 33 to 34
try {
try {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same here

Comment on lines 49 to 50
try {
try {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same

Comment on lines 15 to 16
try {
try {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same

Comment on lines 16 to 17
} finally {
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useless finally


setUsers(usersFromServer);
} catch {
throw new Error('Unable to load users');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not throw an error inside catch

@Krykunov
Copy link
Author

Krykunov commented Dec 5, 2024

I couldn’t pass two tests: ‘should not request posts from API’ and ‘should not request comments from API’, even though the application is working as intended. The other tests was passed ok

@Krykunov Krykunov requested a review from Moroz-Dmytro December 5, 2024 15:14
Copy link

@StasSokolov1 StasSokolov1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants